package ar.com.temporis.framework.common.comparator;

/**
 * This interface defines the minimal behavior that a bean verifier must follow.
 *
 * @author raul.bajales@gmail.com
 */
public interface BeanComparator{

  /**
   * Compares two beans. The meaning of the comparison should be defined in the
   * concrete class, but basically it can follow the rule that the comparison
   * implies compare the two beans (of the same class) to see the differences
   * between each of the accessible members ("accessible" here means the public
   * members and those non-public members that has getter methods).
   * 
   * @param bean1 The first bean to compare.
   * @param bean2 The second bean to compare.
   */
  public void compare(Object bean1, Object bean2);

  /**
   * Returns the result for the comparison, it is separated from the
   * verification method, because the verification process could imply a big
   * effort, and does not make any sense make that effort each time that you
   * need the verification result.
   * This verification result basically means that the verification was
   * successful or not (and in most cases that could means that a successful
   * verification implies that the compared beans are equals). 
   *
   * @return True if the comparison was successful, false otherwise.
   */
  public boolean comparisonResult();
  
  /**
   * @return The meaningful information about the comparison (typically the
   * differenced between each of the beans).  
   */
  public String getLog();
}
